package com.acxy.ants.core.plugin.entity;

import java.io.Serializable;

/**
 * @author MrShun
 * @version 1.0
 * @Date 2017-09-08
 */
public class Cache implements Serializable {

    //开始创建时间
    private long st;

    //对象
    private Object obj;

    //存放时间
    private long time;

    public Cache(Object obj) {
        this.st = System.currentTimeMillis();
        this.obj = obj;
        this.time = 0;
    }

    public Cache(Object obj, long time) {
        this.st = System.currentTimeMillis();
        this.obj = obj;
        this.time = time < 0 ? 0 : time;
    }

    public Object getObj() {
        return obj;
    }

    public void setObj(Object obj) {
        this.obj = obj;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public long getStartTime() {
        return st;
    }
}
